package com.m2team.xomnhiepanh;

import android.app.ActionBar;
import android.graphics.Typeface;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import java.util.ArrayList;
import net.simonvt.menudrawer.MenuDrawer;
import net.simonvt.menudrawer.MenuDrawer.OnDrawerStateChangeListener;
import net.simonvt.menudrawer.MenuDrawer.Type;
import net.simonvt.menudrawer.Position;

public class MyActivity
  extends FragmentActivity
  implements AdapterView.OnItemClickListener, StaffChoiceFragment.OnFragmentInteractionListener
{
  private static final String STATE_CURRENT_FRAGMENT = "net.simonvt.menudrawer.samples.FragmentSample";
  ActionBar mActionBar;
  MenuAdapter mAdapter;
  private String mCurrentFragmentTag;
  private FragmentManager mFragmentManager;
  private FragmentTransaction mFragmentTransaction;
  protected ListView mList;
  private MenuDrawer mMenuDrawer;
  ArrayList<MenuItemObj> menuItems;
  
  private ArrayList<MenuItemObj> generateItems()
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add(new MenuItemObj(getString(2131034162), 2130837623));
    localArrayList.add(new MenuItemObj(getString(2131034163), 2130837622));
    localArrayList.add(new MenuItemObj(getString(2131034164), 2130837625));
    localArrayList.add(new MenuItemObj(getString(2131034165), 2130837623));
    localArrayList.add(new MenuItemObj(getString(2131034166), 2130837633));
    localArrayList.add(new MenuItemObj(getString(2131034167), 2130837624));
    localArrayList.add(new MenuItemObj(getString(2131034168), 2130837623));
    return localArrayList;
  }
  
  private Fragment getFragment(String paramString)
  {
    Object localObject = this.mFragmentManager.findFragmentByTag(paramString);
    if (localObject == null)
    {
      if (paramString != ((MenuItemObj)this.menuItems.get(0)).itemName) {
        break label40;
      }
      localObject = StaffChoiceFragment.newInstance("http://xomnhiepanh.com/?mod=gallery&act=staffchoice", 0);
    }
    label40:
    while (paramString != ((MenuItemObj)this.menuItems.get(1)).itemName) {
      return localObject;
    }
    return StaffChoiceFragment.newInstance("http://xomnhiepanh.com/?mod=gallery&act=categories&catid=6&t=phong-canh-landscape", 1);
  }
  
  protected void attachFragment(int paramInt, Fragment paramFragment, String paramString)
  {
    if (paramFragment != null)
    {
      if (!paramFragment.isDetached()) {
        break label26;
      }
      ensureTransaction();
      this.mFragmentTransaction.attach(paramFragment);
    }
    label26:
    while (paramFragment.isAdded()) {
      return;
    }
    ensureTransaction();
    this.mFragmentTransaction.add(paramInt, paramFragment, paramString);
  }
  
  protected void commitTransactions()
  {
    if ((this.mFragmentTransaction != null) && (!this.mFragmentTransaction.isEmpty()))
    {
      this.mFragmentTransaction.commit();
      this.mFragmentTransaction = null;
    }
  }
  
  protected void detachFragment(Fragment paramFragment)
  {
    if ((paramFragment != null) && (!paramFragment.isDetached()))
    {
      ensureTransaction();
      this.mFragmentTransaction.detach(paramFragment);
    }
  }
  
  protected FragmentTransaction ensureTransaction()
  {
    if (this.mFragmentTransaction == null)
    {
      this.mFragmentTransaction = this.mFragmentManager.beginTransaction();
      this.mFragmentTransaction.setTransition(4099);
    }
    return this.mFragmentTransaction;
  }
  
  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.mFragmentManager = getSupportFragmentManager();
    this.mMenuDrawer = MenuDrawer.attach(this, MenuDrawer.Type.BEHIND, Position.LEFT, 1);
    this.mMenuDrawer.setContentView(2130903065);
    this.mMenuDrawer.setMenuView(2130903078);
    this.mMenuDrawer.setBackgroundColor(-1);
    this.mMenuDrawer.setDrawerIndicatorEnabled(true);
    if (Build.VERSION.SDK_INT >= 14)
    {
      this.mActionBar = getActionBar();
      this.mActionBar.setDisplayShowHomeEnabled(false);
      this.mActionBar.setDisplayShowTitleEnabled(false);
      View localView = LayoutInflater.from(this).inflate(2130903074, null);
      TextView localTextView = (TextView)localView.findViewById(2131099736);
      localTextView.setText(getString(2131034178));
      ((ImageView)localView.findViewById(2131099737)).setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          MyActivity.this.mMenuDrawer.toggleMenu();
        }
      });
      ((ImageButton)localView.findViewById(2131099738));
      this.mActionBar.setCustomView(localView);
      this.mActionBar.setDisplayShowCustomEnabled(true);
      localTextView.setTypeface(Typeface.createFromAsset(getAssets(), "font/UVF Juice.ttf"));
    }
    ListView localListView = (ListView)findViewById(2131099748);
    this.menuItems = generateItems();
    this.mAdapter = new MenuAdapter(this, this.menuItems);
    localListView.setAdapter(this.mAdapter);
    this.mAdapter.notifyDataSetChanged();
    localListView.setOnItemClickListener(this);
    if (paramBundle != null) {
      this.mCurrentFragmentTag = paramBundle.getString("net.simonvt.menudrawer.samples.FragmentSample");
    }
    for (;;)
    {
      this.mMenuDrawer.setOnDrawerStateChangeListener(new MenuDrawer.OnDrawerStateChangeListener()
      {
        public void onDrawerSlide(float paramAnonymousFloat, int paramAnonymousInt) {}
        
        public void onDrawerStateChange(int paramAnonymousInt1, int paramAnonymousInt2)
        {
          if (paramAnonymousInt2 == 0) {
            MyActivity.this.commitTransactions();
          }
        }
      });
      return;
      this.mCurrentFragmentTag = ((MenuItemObj)this.mAdapter.getItem(0)).itemName;
      attachFragment(this.mMenuDrawer.getContentContainer().getId(), getFragment(this.mCurrentFragmentTag), this.mCurrentFragmentTag);
      commitTransactions();
    }
  }
  
  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    return true;
  }
  
  public void onFragmentInteraction(String paramString) {}
  
  public void onItemClick(AdapterView<?> paramAdapterView, View paramView, int paramInt, long paramLong)
  {
    if (this.mCurrentFragmentTag != null) {
      detachFragment(getFragment(this.mCurrentFragmentTag));
    }
    MenuItemObj localMenuItemObj = (MenuItemObj)this.menuItems.get(paramInt);
    attachFragment(this.mMenuDrawer.getContentContainer().getId(), getFragment(localMenuItemObj.itemName), localMenuItemObj.itemName);
    this.mCurrentFragmentTag = localMenuItemObj.itemName;
    this.mMenuDrawer.closeMenu();
  }
  
  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    if (paramMenuItem.getItemId() == 16908332)
    {
      this.mMenuDrawer.toggleMenu();
      return true;
    }
    return super.onOptionsItemSelected(paramMenuItem);
  }
}



/* Location:           C:\Users\Administrator\Downloads\Convert APK to Code\dex2jar-0.0.9.15\dex2jar-0.0.9.15\classes-dex2jar.jar

 * Qualified Name:     com.m2team.xomnhiepanh.MyActivity

 * JD-Core Version:    0.7.0.1

 */